Warn for unknown options passed to filters, too.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 6 Apr 2006 01:55:30 +0000 (01:55 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 6 Apr 2006 01:55:30 +0000 (01:55 +0000)
gpsbabel/filter_vecs.c
gpsbabel/vecs.c

index 6924d908530917697b0fea59902b83fb80baaf31..51dd1924496ce71f1fec1207bbf82979b1a73b5a 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Describe vectors containing filter operations.
  
-    Copyright (C) 2002,2004,2005 Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002,2004,2005,2006 Robert Lipe, robertlipe@usa.net
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -123,6 +123,7 @@ find_filter_vec(char *const vecname, char **opts)
        fl_vecs_t *vec = filter_vec_list;
        char *v = xstrdup(vecname);
        char *svecname = strtok(v, ",");
+       int found = 0;
 
        while (vec->vec) {
                arglist_t *ap;
@@ -156,12 +157,16 @@ find_filter_vec(char *const vecname, char **opts)
                                        
                                        opt = get_option(*opts, ap->argstring);
                                        if ( opt ) {
+                                               found = 1;
                                                assign_option(vec->name, ap, opt);
                                                xfree(opt);
                                        }
                                }
                        }
                }
+               if (opts && opts[0] && !found) {
+                       warning("'%s' is an unknown option to %s.\n", *opts, vec->name);
+               }
 
                if (global_opts.debug_level >= 1)
                        disp_vec_options(vec->name, vec->vec->args);
index b0e3d26aa67dda2ee02e92c7373878037bff0ab9..207679709016ade537ecbd88e377ad878a975f9b 100644 (file)
@@ -1,7 +1,7 @@
 /*
     Describe vectors containing file operations.
  
-    Copyright (C) 2002, 2004, 2005  Robert Lipe, robertlipe@usa.net
+    Copyright (C) 2002, 2004, 2005, 2006  Robert Lipe, robertlipe@usa.net
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by